﻿#ifndef CUSTOMTABBAR_H
#define CUSTOMTABBAR_H

#include <QtWidgets>
#include <QTabBar>

class CustomTabBar : public QTabBar
{
    Q_OBJECT
public:
    explicit CustomTabBar(QWidget *parent = nullptr);
protected:
    QSize tabSizeHint(int index) const override;
    void paintEvent(QPaintEvent *event) override;
    void mousePressEvent(QMouseEvent *event) override;
private:
    QString getElidedText(QFont font, QString str, int MaxWidth);
};

#endif // CUSTOMTABBAR_H
